package com.heima.leadnews.article.service.Impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.leadnews.article.mapper.ApArticleConfigMapper;
import com.heima.leadnews.article.service.ApArticleConfigService;
import com.heima.model.article.pojo.ApArticleConfig;
import org.springframework.stereotype.Service;

@Service
public class ApArticleConfigServiceImpl extends ServiceImpl<ApArticleConfigMapper, ApArticleConfig> implements ApArticleConfigService {
    @Override
    public void updateIsDown(String articleId, String enable) {
        LambdaUpdateWrapper<ApArticleConfig> wrapper = new LambdaUpdateWrapper<>();
        wrapper.eq(ApArticleConfig::getArticleId,articleId);
        wrapper.set(ApArticleConfig::getIsDown,"0".equals(enable));
        update(wrapper);
    }
}
